#include "nnsliteglobal.h"

nnsliteObject nnsliteObjectCopy(const nnsliteObject* src)
{
	nnsliteObject newobj;
	newobj.id = src->id;
	newobj.size = src->size;
	newobj.data = (void*)malloc(newobj.size);
	memcpy(newobj.data, src->data, newobj.size);
	return newobj;
}


NNSLITE_RET nnsliteObjectInit(nnsliteObject* obj)
{
	obj->data = NULL;
	obj->id = 0;
	obj->size = 0;
	return NNSLITE_RET_OK;
}

NNSLITE_RET nnsliteObjectFree(nnsliteObject* obj)
{
	if (obj->data != NULL)
		free(obj->data);
	obj->data = NULL;
	obj->id = 0;
	obj->size = 0;
	return NNSLITE_RET_OK;
}

